package com.qianfeng.day2.myclient3.service;

import org.springframework.cloud.openfeign.FeignClient;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Service
@FeignClient(value = "SERVICE-HI",fallback = HelloServiceHystrix.class)
public interface HelloService {
    @RequestMapping("/hi")
     String hello(@RequestParam("name") String name);
}
@Component
class HelloServiceHystrix implements HelloService{
    @Override
    public String hello(String name) {
        return "sorry"+name;
    }
}
